package cn.yunhe.test;

import java.util.Arrays;

public class MaoPao {

    public static void main(String[] args) {
        int[] arr = {9, 5, 3, 4, 2, 6, 8, 7, 1};
        /*for (int i = 0; i < arr.length - 1; i++) {
            for (int j = 0; j < arr.length - 1 - i; j++) {
                if (arr[j] > arr[j + 1]) {
                    int num;
                    num = arr[j];
                    arr[j] = arr[j + 1];
                    arr[j + 1] = num;
                }

            }
        }

        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }*/


        String str = "abcdefg";
        /*StringBuilder sb = new StringBuilder(str);
        sb.reverse();
        System.out.println(sb);*/

        char[] stra=str.toCharArray();
        for (int min = 0, max = stra.length - 1; min < max; min++, max--) {
            char num;
            num = stra[min];
            stra[min] = stra[max];
            stra[max] = num;
        }


        for (int i=0;i<stra.length;i++){
            System.out.print(stra[i]);
        }



        /*for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i]);
        }


        System.out.println("");
        for (int min = 0, max = arr.length - 1; min < max; min++, max--) {
            int num;
            num = arr[min];
            arr[min] = arr[max];
            arr[max] = num;
        }
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i]);
        }*/
    }
}
